﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace N2.Edit
{
	using N2.Edit.Web;
	using N2.Details;

	[NavigationLinkPlugin(
		"Properties",
		"properties",
		"~/PropertyGrid/Edit/Properties.aspx?selected={selected}&memory={memory}&action={action}",
		Targets.Preview,
		"~/PropertyGrid/Edit/img/properties.gif",
		60,
		GlobalResourceClassName = "Navigation")]
	public partial class Properties : EditPage
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!this.IsPostBack) {
				this.pg.SelectedObject = this.SelectedItem;
			}
		}

		protected override void OnInit(EventArgs e)
		{
			if (null != this.SelectedItem) {
				TypeDescriptor.AddProvider(
					new ContentItemTypeDescriptionProvider(),
					this.SelectedItem);
			}
			
			base.OnInit(e);
		}
	}
}
